<div class="index">
<?php
$currentUsr = $session->read('MyApp_Users.InfoSettings.authCurrentUser');

echo '<p>Добре дошли, <strong>'.$currentUsr["User"]["username"].'</strong>!</p>';

echo '- '.$this->Html->link(__d('', 'Потребителски профил', true), array('admin' => false, 'controller' => 'users', 'action' => 'view', $currentUsr["User"]["id"])).'<br />';

/**
 * Tyk zadavame za syotvetnite id-ta na grupi dali da se poqvqva link kym admin panela
 * 
 * ===== groups
 * root = 1
 * administrator = 3
 * moderator = 4
 * editor = 5
 * ====/ groups
 */
if(
	($currentUsr["User"]["group_id"]==1) 
		|| 
	($currentUsr["User"]["group_id"]==3) 
		|| 
	($currentUsr["User"]["group_id"]==4) 
		|| 
	($currentUsr["User"]["group_id"]==5)
) {
	echo '- '.$this->Html->link(__d('', 'контролен панел', true), array('locale' => Configure::read('MyApp_Settings.defaultLanguage'), 'admin' => true, 'controller' => 'control_panel', 'action' => 'index'), array('style' => 'color: red', 'target' => '_blank'));
}
?>
</div>
<?php 

if(empty($listing) ){ ?>
      <a href="javascript:void(0)" onclick="alert('You have not added any listing.')" >My Listings: </a>

<?php } else { 
  		echo "<b>My Listings</b><ol>";
 		foreach($listing as $listing){

		echo "<li>".$this->Html->link($listing['Listing']['title'], array('admin' => false, 'controller' => 'listings', 'action' => 'claim', $listing['Listing']['id']))."</li>";
	} 
echo "</ol>";
}
if(empty($review) ){ ?>
      <a href="javascript:void(0)" onclick="alert('You have not added review on listing.')" >My Reviews: </a>

<?php } else { 
  		echo "<b>My Reviews</b><ol>";
 		foreach($review as $review){

		echo "<li>".$review['Review']['content']."</li>";
	} 
echo "</ol>";
}?>
